//package com.hibase.demo.controller;
//
//import com.hibase.common.entity.ResponseModel;
//import com.hibase.core.emqx.publisher.MqttPublisher;
//import com.hibase.core.web.annotation.HibasePostRequestMapping;
//import com.hibase.core.web.annotation.HibaseRepeatIntercept;
//import com.hibase.demo.entity.PrintVO;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * @author chenfeng
// * @version 1.0
// * @date 2021/7/21 11:51
// * @des https://gitee.com/cheershi
// */
//@RestController
//@RequestMapping("/test")
//@Api("测试")
//@Component
//public class TestController {
//
//    @Value("{hibase.auth.enabledd:true}")
//    private String en;
//
//    @Autowired
//    private MqttPublisher publisher;
//
//    @ApiOperation(value = "错误信息测试", httpMethod = "POST")
//    @HibasePostRequestMapping(value = "message")
//    public ResponseModel message() {
//
//        int a = 1/0;
//        return ResponseModel.successMsg();
//    }
//
////    @ApiOperation(value = "测试美的", httpMethod = "POST")
////    @HibasePostRequestMapping(value = "meidi")
////    @HibaseApi(type = "ORDERS")
////    public ResponseModel meidi(@RequestBody String requestJson) {
////
////        return ResponseModel.successMsg();
////    }
//
//    @HibaseRepeatIntercept(3000)
//    @ApiOperation(value = "测试3秒内防止重复提交", httpMethod = "POST")
//    @HibasePostRequestMapping(value = "noRepeat")
//    public ResponseModel noRepeat(@RequestBody String requestJson) {
//
//        return ResponseModel.successMsg();
//    }
//
//    @HibaseRepeatIntercept(5000)
//    @ApiOperation(value = "测试5秒内防止重复提交", httpMethod = "POST")
//    @HibasePostRequestMapping(value = "noRepeat2")
//    public ResponseModel noRepeat2(@RequestBody String requestJson) {
//        try {
//            Thread.sleep(3000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        return ResponseModel.successMsg();
//    }
//
//    /**
//     * 发送一条信息到emq
//     */
//    @ApiOperation(value = "发送一条信息到emq", httpMethod = "POST")
//    @HibasePostRequestMapping(value = "emqxPush")
//    public void pushMesg(@RequestBody String requestBody) {
//        publisher.send("wms/midea", requestBody);
//    }
//
//    /**
//     * midea mqtt测试
//     */
//    @ApiOperation(value = "midea mqtt测试", httpMethod = "POST")
//    @HibasePostRequestMapping(value = "emqxMidea")
//    public void emqxMidea(@RequestBody PrintVO printVO) {
//        publisher.send("wms/midea", printVO);
//    }
//}
